package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-09-17
 * Time: 20:45
 */
public class BookList{
    private Book[] books;//管理书的数组
    private int usedSize;//记录书的数量
    private static final int DEFAULT_CAPACITY = 10;
    public BookList(){
        //默认初始化三本书
        this.books = new Book[DEFAULT_CAPACITY];
        books[0] = new Book("三国演义" ,"罗贯中" ,"小说", 10);
        books[1] = new Book("西游记", "吴承恩","小说",9);
        books[2] = new Book("红楼梦", "曹雪芹", "小说", 19);
        this.usedSize = 3;
    }
    public Book getBook(int pos) {
        return books[pos];
    }
    public Book setBook(int pos, Book book) {
        return books[pos] = book;
    }
    public Book[] getBooks() {
        return books;
    }
    public int getUsedSize() {
        return usedSize;
    }
    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
